package model 
{
	import events.MovedObjectEvent;
	import flash.events.EventDispatcher;
	import flash.geom.Point;
	import statemachine.IState;
	import statemachine.IStateObject;
	import states.FindResourceState;
	/**
	 * ...
	 * @author vkozhaev
	 */
	public class MSpaceship extends MovedObject implements IStateObject
	{
		private var _state:IState;
		private var _energy:int=SetParameters.BASE_ENERGY;
		private var _cargoBay:int = 0;;
		private var _processedAsteroid:MAsteroid;
		
		public function MSpaceship() 
		{
			_state = new FindResourceState(this,new Point(0, 1));
		}
		
		
		public function get state():IState {
			return _state;
		}
		
		public function set state(val:IState):void {
			this._state = val;
			_state.stateObject = this;
		}
		
		/*private function changeCoordsEvent():void {
			dispatchEvent(new MovedObjectEvent(this,MovedObjectEvent.MOVE));
		}*/
		
		public function get energy():int {
			return _energy;			
		}
		
		public function set energy(val:int):void {
			this._energy=val;			
		}
		
		public function get cargoBay():int {
			return _cargoBay;
		}
		
		public function set cargoBay(val:int):void {
			this._cargoBay = val;
		}
		
		public function get processedAsteroid():MAsteroid {
			return _processedAsteroid;
		}
		
		public function set processedAsteroid(val:MAsteroid):void {
			this._processedAsteroid=val;
		}
		
	}

}